﻿.brand-logo {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));

  font-family: 'Satoshi', sans-serif;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 600;
  letter-spacing: 1px;

  color: rgba(255, 255, 255, 0.7);

  z-index: 1000;

  cursor: default;
  user-select: none;

  transition: all 0.3s ease;
}

.brand-logo:hover {
  color: rgba(255, 255, 255, 1);
}

:root {
  --bg-color: #121212;
  --theme-color: #ffffff;
  --font-family: 'Inter', sans-serif;
  --segment-bg: #000000;
  --clock-bg: #111111;
  --segment-border: #222222;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  background-color: var(--bg-color);
  color: var(--theme-color);
  font-family: var(--font-family);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  position: fixed; /* Prevent pull-to-refresh on mobile if desired, or use touch-action */
  touch-action: manipulation;
}

#appContent {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Custom Aesthetic Scrollbar */
*::-webkit-scrollbar {
  width: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}



/* Navbar */
.top-nav {
  position: absolute;
  top: 30px;
  right: 30px;
  display: flex;
  gap: 15px;
  z-index: 100;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--theme-color);
  font-size: 24px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.icon-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Container */
.pomodoro-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
}

/* Mode Toggles */
.top-mode-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  margin-bottom: 28px !important;
}

.top-mode-row::before {
  content: "";
  display: block;
}

.mode-toggles {
  grid-column: 2;
  display: flex;
  gap: 10px;
  background: var(--segment-bg);
  border: 4px solid var(--segment-border);
  padding: 6px 8px;
  border-radius: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--theme-color);
  font-family: var(--font-family);
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 20px;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-btn.active {
  background: var(--clock-bg);
  border-radius: 20px;
  border: 1px solid #222;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
  opacity: 1;
  font-weight: 700;
}

/* Original Flipclock Layout adjusted for Fliqlo style */
.countdown {
  display: flex;
  gap: 20px;
  align-items: center;
}

.time-section {
  text-align: center;
}

.time-group {
  display: flex;
  gap: 10px;
}

.time-segment {
  display: block;
  font-size: 180px;
  font-weight: 700;
  width: 140px;
  height: 220px;
  border-radius: 12px;
  background-color: var(--segment-bg);
  border: 4px solid var(--segment-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.segment-display {
  position: relative;
  height: 100%;
}

.segment-display__top,
.segment-display__bottom {
  overflow: hidden;
  text-align: center;
  width: 100%;
  height: 50%;
  position: relative;
  color: var(--theme-color);
}

.segment-display__top {
  line-height: 220px;
  background-color: var(--clock-bg);
  border-bottom: 2px solid #000;
  border-radius: 8px 8px 0 0;
}

.segment-display__bottom {
  line-height: 0;
  background-color: var(--clock-bg);
  border-top: 2px solid #222;
  border-radius: 0 0 8px 8px;
}

.segment-overlay {
  position: absolute;
  top: 0;
  perspective: 600px;
  height: 100%;
  width: 100%;
}

.segment-overlay__top,
.segment-overlay__bottom {
  position: absolute;
  overflow: hidden;
  text-align: center;
  width: 100%;
  height: 50%;
  color: var(--theme-color);
}

.segment-overlay__top {
  top: 0;
  line-height: 220px;
  background-color: var(--clock-bg);
  transform-origin: bottom;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid #000;
}

.segment-overlay__bottom {
  bottom: 0;
  line-height: 0;
  background-color: var(--clock-bg);
  border-top: 2px solid #222;
  transform-origin: top;
  border-radius: 0 0 8px 8px;
}

.time-colon {
  font-size: 100px;
  font-weight: 700;
  color: var(--theme-color);
  line-height: 1;
  margin-bottom: 20px;
}

/* Original Animation from User */
.segment-overlay.flip .segment-overlay__top {
  animation: flip-top 0.8s linear;
}

.segment-overlay.flip .segment-overlay__bottom {
  animation: flip-bottom 0.8s linear;
}

@keyframes flip-top {
  0% {
    transform: rotateX(0deg);
  }

  50%,
  100% {
    transform: rotateX(-90deg);
  }
}

@keyframes flip-bottom {

  0%,
  50% {
    transform: rotateX(90deg);
  }

  100% {
    transform: rotateX(0deg);
  }
}

/* Controls */
.controls {
  margin-top: 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.start-btn {
  background-color: var(--theme-color);
  color: var(--bg-color);
  border: none;
  font-family: var(--font-family);
  font-size: 24px;
  font-weight: 700;
  padding: 15px 60px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.start-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.start-btn:active {
  transform: translateY(0);
}

/* Modals & Widgets */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.modal-content {
  background: var(--clock-bg);
  border: 1px solid #333;
  border-radius: 16px;
  width: 400px;
  padding: 30px;
  color: #fff;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.close-btn {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 20px;
  cursor: pointer;
}

.close-btn:hover {
  color: #fff;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.setting-row label {
  font-size: 14px;
  color: #ccc;
}

.setting-row input[type="number"] {
  width: 80px;
  background: #222;
  border: 1px solid #444;
  color: #fff;
  padding: 8px;
  border-radius: 6px;
  text-align: right;
  font-family: var(--font-family);
}

.setting-row input[type="color"] {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.setting-row select {
  background: #222;
  border: 1px solid #444;
  color: #fff;
  padding: 8px;
  border-radius: 6px;
  font-family: var(--font-family);
}

.mt-20 {
  margin-top: 30px;
  margin-bottom: 15px;
  border-top: 1px solid #333;
  padding-top: 15px;
}

.settings-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.reset-btn {
  flex: 0 0 auto;
  background: transparent;
  color: #aaa;
  border: 1px solid #444;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.2s ease;
}

.reset-btn:hover {
  color: #fff;
  border-color: #888;
  background: rgba(255, 255, 255, 0.05);
}

.save-btn {
  flex: 1;
  background: #fff;
  color: #000;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

/* Spotify Widget */
.floating-widget {
  position: fixed;
  top: 30px;
  left: 90px;
  width: 350px;
  background: rgba(20, 20, 20, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  z-index: 50;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.widget-header h3 {
  font-size: 16px;
  color: #1DB954;
  display: flex;
  gap: 10px;
  align-items: center;
}

.widget-hint {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 10px;
}

.spotify-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.spotify-input-group input {
  flex: 1;
  background: #222;
  border: 1px solid #444;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
}

.spotify-input-group button {
  background: #1DB954;
  color: #fff;
  border: none;
  padding: 0 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.hidden {
  display: none !important;
}

/* =========================================
   TASK PROGRESSION & HAMSTER TRACKER
========================================= */

.task-tracker-wrapper {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 15px;
  transform: scale(var(--tracker-scale, 1));
  transform-origin: bottom right;
  transition: transform 0.2s ease;
}

/* --- Task Panel (Pomofocus Style) --- */
.task-panel {
  position: fixed;
  left: 90px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 20, 20, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 380px;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 105;
}

.task-panel.hidden {
  opacity: 0;
  transform: translateY(-50%) translateX(-20px);
  pointer-events: none;
}

.task-panel:not(.hidden) {
  display: flex !important;
}

.task-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.task-panel-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.task-list-container {
  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 15px;
  padding-right: 5px;
}

.task-list-container::-webkit-scrollbar {
  width: 6px;
}

.task-list-container::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 10px;
}

/* Individual Task Item */
.task-item {
  background: rgba(20, 20, 20, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 4px solid transparent;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.task-item:hover {
  background: rgba(40, 40, 40, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.task-item.active {
  border-left-color: #a855f7;
  background: rgba(50, 50, 50, 0.6);
  border-color: rgba(168, 85, 247, 0.3);
}

.task-item.done {
  opacity: 0.6;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: #888;
}

.task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.task-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.task-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: transparent;
  transition: all 0.2s;
  background: rgba(0, 0, 0, 0.2);
}

.task-checkbox:hover {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
}

.task-checkbox.checked {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  border-color: transparent;
  color: white;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.task-title {
  font-size: 14px;
  font-weight: 500;
  color: #ddd;
  flex-grow: 1;
  word-break: break-word;
}

.task-ticks {
  font-size: 13px;
  color: #aaa;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Add Task Button */
.add-task-trigger {
  width: 100%;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  color: #ccc;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.add-task-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Add Task Form */
.add-task-form {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
}

.add-task-form:not(.hidden) {
  display: flex !important;
}

.task-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid #555;
  color: #fff;
  font-size: 16px;
  padding: 8px 0;
  outline: none;
  font-family: var(--font-family);
}

.task-input:focus {
  border-color: #4abaff;
}

.est-pomodoros {
  display: flex;
  align-items: center;
  gap: 15px;
}

.est-pomodoros label {
  font-size: 14px;
  color: #aaa;
  font-weight: 500;
}

.est-controls {
  display: flex;
  align-items: center;
  background: #333;
  border-radius: 6px;
  overflow: hidden;
}

.est-controls input {
  background: transparent;
  border: none;
  color: #fff;
  width: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 0;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.est-controls input::-webkit-outer-spin-button,
.est-controls input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.est-btns {
  display: flex;
  flex-direction: column;
  background: #444;
}

.est-btn {
  background: transparent;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 2px 8px;
  font-size: 10px;
}

.est-btn:hover {
  color: #fff;
  background: #555;
}

.add-task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 5px;
}

.cancel-btn {
  background: transparent;
  color: #888;
  border: none;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 12px;
}

.cancel-btn:hover {
  color: #fff;
}

.save-task-btn {
  background: #4abaff;
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 4px;
}

.task-item.active {
  border-left-color: #4abaff;
  background: #333;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: #888;
}

.task-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #555;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: transparent;
  transition: all 0.2s;
}

.task-checkbox.checked {
  background: #4abaff;
  border-color: #4abaff;
  color: white;
}

.task-title {
  font-size: 14px;
  font-weight: 500;
  color: #ddd;
  flex-grow: 1;
  word-break: break-word;
}

.task-ticks {
  font-size: 13px;
  color: #aaa;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Add Task Button */
.add-task-trigger {
  width: 100%;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  color: #ccc;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.add-task-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Add Task Form */
.add-task-form {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
}

.add-task-form:not(.hidden) {
  display: flex !important;
}

.task-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid #555;
  color: #fff;
  font-size: 16px;
  padding: 8px 0;
  outline: none;
  font-family: var(--font-family);
}

.task-input:focus {
  border-color: #4abaff;
}

.est-pomodoros {
  display: flex;
  align-items: center;
  gap: 15px;
}

.est-pomodoros label {
  font-size: 14px;
  color: #aaa;
  font-weight: 500;
}

.est-controls {
  display: flex;
  align-items: center;
  background: #333;
  border-radius: 6px;
  overflow: hidden;
}

.est-controls input {
  background: transparent;
  border: none;
  color: #fff;
  width: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 0;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.est-controls input::-webkit-outer-spin-button,
.est-controls input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.est-btns {
  display: flex;
  flex-direction: column;
  background: #444;
}

.est-btn {
  background: transparent;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 2px 8px;
  font-size: 10px;
}

.est-btn:hover {
  color: #fff;
  background: #555;
}

.add-task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 5px;
}

.cancel-btn {
  background: transparent;
  color: #888;
  border: none;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 12px;
}

.cancel-btn:hover {
  color: #fff;
}

.save-task-btn {
  background: #4abaff;
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 4px;
}

.save-task-btn:hover {
  background: #3a9adf;
}

/* --- Lower Tracker Widget --- */
.tracker-widget {
  background: #252525;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
  position: relative;
}

/* Pet Close Button */
.pet-close-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #888;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 12px;
  z-index: 20;
  transition: all 0.2s ease;
  opacity: 0;
}

.tracker-widget:hover .pet-close-btn {
  opacity: 1;
}

.pet-close-btn:hover {
  background: rgba(255, 94, 94, 0.2);
  color: #ff5e5e;
  transform: scale(1.1);
}

/* Show Pet Floating Button */
.show-pet-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: linear-gradient(135deg, #4abaff, #2b8cd6);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 20px;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(74, 186, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: petBtnPulse 2s ease-in-out infinite;
}

.show-pet-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 25px rgba(74, 186, 255, 0.6);
}

.show-pet-btn.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

@keyframes petBtnPulse {

  0%,
  100% {
    box-shadow: 0 6px 20px rgba(74, 186, 255, 0.4);
  }

  50% {
    box-shadow: 0 6px 30px rgba(74, 186, 255, 0.6);
  }
}

/* Task Tracker Wrapper – Draggable */
.task-tracker-wrapper {
  cursor: default;
  transition: transform 0.2s ease, opacity 0.3s ease;
}

.task-tracker-wrapper.pet-hidden {
  opacity: 0;
  transform: scale(var(--tracker-scale, 1)) translateY(20px);
  pointer-events: none;
}

.tracker-progress-bg {
  background: #252525;
}

.tracker-progress-bar {
  height: 6px;
  background: #4abaff;
  width: 0%;
  /* JS controlled */
  border-radius: 8px 8px 0 0;
  transition: width 1s linear;
}

.tracker-main {
  position: relative;
  display: flex;
  align-items: center;
}

.task-tab-btn {
  position: absolute;
  left: -32px;
  top: var(--tab-y, 10px);
  background: #252525;
  color: #ccc;
  border: none;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-family);
  padding: 10px 8px;
  border-radius: 6px 0 0 6px;
  cursor: grab;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  transition: background 0.2s;
  user-select: none;
}

.task-tab-btn:active {
  cursor: grabbing;
}

.task-tab-btn:hover {
  background: #333;
}

.hamster-container {
  padding: 45px 15px 15px 15px;
  background: #252525;
  border-radius: 0 0 8px 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-width: 280px;
  min-height: 260px;
}




/* =========================================
   HAMSTER TRACKER
========================================= */

.wheel-and-hamster {
  --dur: 1s;
  position: relative;
  width: 12em;
  height: 12em;
  font-size: 14px;
}

.wheel-and-hamster.paused * {
  animation-play-state: paused !important;
}

.wheel,
.hamster,
.hamster div,
.spoke {
  position: absolute;
}

.wheel,
.spoke {
  border-radius: 50%;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.wheel {
  background: radial-gradient(100% 100% at center, hsla(0, 0%, 60%, 0) 47.8%, hsl(0, 0%, 60%) 48%);
  z-index: 2;
}

.hamster {
  animation: hamster var(--dur) ease-in-out infinite;
  top: 50%;
  left: calc(50% - 3.5em);
  width: 7em;
  height: 3.75em;
  transform: rotate(4deg) translate(-0.8em, 1.85em);
  transform-origin: 50% 0;
  z-index: 1;
}

.hamster__head {
  animation: hamsterHead var(--dur) ease-in-out infinite;
  background: hsl(30, 90%, 55%);
  border-radius: 70% 30% 0 100% / 40% 25% 25% 60%;
  box-shadow: 0 -0.25em 0 hsl(30, 90%, 80%) inset,
    0.75em -1.55em 0 hsl(30, 90%, 90%) inset;
  top: 0;
  left: -2em;
  width: 2.75em;
  height: 2.5em;
  transform-origin: 100% 50%;
}

.hamster__ear {
  animation: hamsterEar var(--dur) ease-in-out infinite;
  background: hsl(0, 90%, 85%);
  border-radius: 50%;
  box-shadow: -0.25em 0 hsl(30, 90%, 55%) inset;
  top: -0.25em;
  right: -0.25em;
  width: 0.75em;
  height: 0.75em;
  transform-origin: 50% 75%;
}

.hamster__eye {
  animation: hamsterEye var(--dur) linear infinite;
  background-color: hsl(0, 0%, 0%);
  border-radius: 50%;
  top: 0.375em;
  left: 1.25em;
  width: 0.5em;
  height: 0.5em;
}

.hamster__nose {
  background: hsl(0, 90%, 75%);
  border-radius: 35% 65% 85% 15% / 70% 50% 50% 30%;
  top: 0.75em;
  left: 0;
  width: 0.2em;
  height: 0.25em;
}

.hamster__body {
  animation: hamsterBody var(--dur) ease-in-out infinite;
  background: hsl(30, 90%, 90%);
  border-radius: 50% 30% 50% 30% / 15% 60% 40% 40%;
  box-shadow: 0.1em 0.75em 0 hsl(30, 90%, 55%) inset,
    0.15em -0.5em 0 hsl(30, 90%, 80%) inset;
  top: 0.25em;
  left: 2em;
  width: 4.5em;
  height: 3em;
  transform-origin: 17% 50%;
  transform-style: preserve-3d;
}

.hamster__limb--fr,
.hamster__limb--fl {
  clip-path: polygon(0 0, 100% 0, 70% 80%, 60% 100%, 0% 100%, 40% 80%);
  top: 2em;
  left: 0.5em;
  width: 1em;
  height: 1.5em;
  transform-origin: 50% 0;
}

.hamster__limb--fr {
  animation: hamsterFRLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30, 90%, 80%) 80%, hsl(0, 90%, 75%) 80%);
  transform: rotate(15deg) translateZ(-1px);
}

.hamster__limb--fl {
  animation: hamsterFLLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30, 90%, 90%) 80%, hsl(0, 90%, 85%) 80%);
  transform: rotate(15deg);
}

.hamster__limb--br,
.hamster__limb--bl {
  border-radius: 0.75em 0.75em 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 30%, 70% 90%, 70% 100%, 30% 100%, 40% 90%, 0% 30%);
  top: 1em;
  left: 2.8em;
  width: 1.5em;
  height: 2.5em;
  transform-origin: 50% 30%;
}

.hamster__limb--br {
  animation: hamsterBRLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30, 90%, 80%) 90%, hsl(0, 90%, 75%) 90%);
  transform: rotate(-25deg) translateZ(-1px);
}

.hamster__limb--bl {
  animation: hamsterBLLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30, 90%, 90%) 90%, hsl(0, 90%, 85%) 90%);
  transform: rotate(-25deg);
}

.hamster__tail {
  animation: hamsterTail var(--dur) linear infinite;
  background: hsl(0, 90%, 85%);
  border-radius: 0.25em 50% 50% 0.25em;
  box-shadow: 0 -0.2em 0 hsl(0, 90%, 75%) inset;
  top: 1.5em;
  right: -0.5em;
  width: 1em;
  height: 0.5em;
  transform: rotate(30deg) translateZ(-1px);
  transform-origin: 0.25em 0.25em;
}

.spoke {
  animation: spoke var(--dur) linear infinite;
  background: radial-gradient(100% 100% at center, hsl(0, 0%, 60%) 4.8%, hsla(0, 0%, 60%, 0) 5%),
    linear-gradient(hsla(0, 0%, 55%, 0) 46.9%, hsl(0, 0%, 65%) 47% 52.9%, hsla(0, 0%, 65%, 0) 53%) 50% 50% / 99% 99% no-repeat;
}

/* Animations */
@keyframes hamster {

  from,
  to {
    transform: rotate(4deg) translate(-0.8em, 1.85em);
  }

  50% {
    transform: rotate(0) translate(-0.8em, 1.85em);
  }
}

@keyframes hamsterHead {

  from,
  25%,
  50%,
  75%,
  to {
    transform: rotate(0);
  }

  12.5%,
  37.5%,
  62.5%,
  87.5% {
    transform: rotate(8deg);
  }
}

@keyframes hamsterEye {

  from,
  90%,
  to {
    transform: scaleY(1);
  }

  95% {
    transform: scaleY(0);
  }
}

@keyframes hamsterEar {

  from,
  25%,
  50%,
  75%,
  to {
    transform: rotate(0);
  }

  12.5%,
  37.5%,
  62.5%,
  87.5% {
    transform: rotate(12deg);
  }
}

@keyframes hamsterBody {

  from,
  25%,
  50%,
  75%,
  to {
    transform: rotate(0);
  }

  12.5%,
  37.5%,
  62.5%,
  87.5% {
    transform: rotate(-2deg);
  }
}

@keyframes hamsterFRLimb {

  from,
  25%,
  50%,
  75%,
  to {
    transform: rotate(50deg) translateZ(-1px);
  }

  12.5%,
  37.5%,
  62.5%,
  87.5% {
    transform: rotate(-30deg) translateZ(-1px);
  }
}

@keyframes hamsterFLLimb {

  from,
  25%,
  50%,
  75%,
  to {
    transform: rotate(-30deg);
  }

  12.5%,
  37.5%,
  62.5%,
  87.5% {
    transform: rotate(50deg);
  }
}

@keyframes hamsterBRLimb {

  from,
  25%,
  50%,
  75%,
  to {
    transform: rotate(-60deg) translateZ(-1px);
  }

  12.5%,
  37.5%,
  62.5%,
  87.5% {
    transform: rotate(20deg) translateZ(-1px);
  }
}

@keyframes hamsterBLLimb {

  from,
  25%,
  50%,
  75%,
  to {
    transform: rotate(20deg);
  }

  12.5%,
  37.5%,
  62.5%,
  87.5% {
    transform: rotate(-60deg);
  }
}

@keyframes hamsterTail {

  from,
  25%,
  50%,
  75%,
  to {
    transform: rotate(30deg) translateZ(-1px);
  }

  12.5%,
  37.5%,
  62.5%,
  87.5% {
    transform: rotate(10deg) translateZ(-1px);
  }
}

@keyframes spoke {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(-1turn);
  }
}

/* --- Animal Switcher UI --- */
.animal-controls {
  position: absolute;
  top: 10px;
  right: 15px;
  left: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.animal-name {
  font-size: 11px;
  color: #ccc;
  font-weight: 700;
  background: #333;
  padding: 4px 8px;
  border-radius: 4px;
}

.animal-switcher-btn {
  background: #4abaff;
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.animal-switcher-btn:hover {
  background: #3a9adf;
  transform: scale(1.1);
}

.animal-animation {
  transition: opacity 0.3s ease;
}

/* --- Animal Selection Menu (Side Panel) --- */
.animal-menu {
  position: fixed;
  top: 100px;
  right: 20px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  z-index: 200;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.animal-menu.hidden {
  transform: translateX(150%);
  opacity: 0;
  display: flex !important;
}

.animal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  background: #2a2a2a;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.animal-card:hover {
  background: #333;
  transform: scale(1.05);
}

.animal-preview-box {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #222;
  border: 1px solid #444;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.animal-card-name {
  font-size: 11px;
  color: #fff;
  font-weight: bold;
}

/* Previews */
.scale-preview {
  transform: scale(0.35);
  transform-origin: center center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.scale-preview.turtles-sprite {
  transform: scale(0.18) translate(-10px, 10px);
}

.scale-preview.puppy-sprite {
  transform: scale(0.18) translate(5px, -20px);
}

.preview-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  border-radius: 50%;
}

.animal-card:hover .preview-icon-img {
  transform: scale(1.15);
}

/* =========================================
   NEW SPRITESHEET ANIMATIONS
========================================= */

/* Turtles */
.turtles-sprite {
  width: 250px;
  /* Equal to puppy */
  height: 200px;
  /* Equal to puppy */
  background: url('turtles.png') 0 0 no-repeat;
  background-size: 1000px 400px;
  transform: translateY(10px) scale(0.8);
}

.turtles-sprite:not(.paused) {
  animation: playTurtles 2s steps(4) infinite;
}

@keyframes playTurtles {
  100% {
    background-position: -1000px 0;
  }
}

/* Puppy */
.puppy-sprite {
  width: 250px;
  /* Approx width of 1/4 image */
  height: 200px;
  /* Approx height of 1/2 image */
  background: url('puppy.png') 0 0 no-repeat;
  background-size: 1000px 400px;
  transform: translateY(10px) scale(0.8);
}

.puppy-sprite:not(.paused) {
  animation: playPuppy 2s steps(4) infinite;
}

@keyframes playPuppy {
  100% {
    background-position: -1000px 0;
  }
}

/* =========================================
   FEIFEI THE CAPYBARA
========================================= */

.capybaraloader,
.capybaraloader-preview {
  width: 14em;
  height: 10em;
  position: relative;
  z-index: 1;
  --color: #ffb7c5;
  --color2: #e77283;
}

.capybaraloader {
  transform: scale(-0.75, 0.75);
  background-color: transparent;
}

.capybaraloader-preview {
  transform: scaleX(-1);
}

.capybara {
  width: 100%;
  height: 7.5em;
  position: relative;
  z-index: 1;
}

.loader {
  width: 100%;
  height: 2.5em;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.capy {
  width: 85%;
  height: 100%;
  background: linear-gradient(var(--color), 90%, var(--color2));
  border-radius: 45%;
  position: relative;
  z-index: 1;
  animation: movebody 1s linear infinite;
}

.capyhead {
  width: 7.5em;
  height: 7em;
  bottom: 0em;
  right: 0em;
  position: absolute;
  background-color: var(--color);
  z-index: 3;
  border-radius: 3.5em;
  box-shadow: -1em 0em var(--color2);
  animation: movebody 1s linear infinite;
}

.capyear {
  width: 2em;
  height: 2em;
  background: linear-gradient(-45deg, var(--color), 90%, var(--color2));
  top: 0em;
  left: 0em;
  border-radius: 100%;
  position: absolute;
  overflow: hidden;
  z-index: 3;
}

.capyear:nth-child(2) {
  left: 5em;
  background: linear-gradient(25deg, var(--color), 90%, var(--color2));
}

.capyear2 {
  width: 100%;
  height: 1em;
  background-color: var(--color2);
  bottom: 0em;
  left: 0.5em;
  border-radius: 100%;
  position: absolute;
  transform: rotate(-45deg);
}

.capymouth {
  width: 3.5em;
  height: 2em;
  background-color: var(--color2);
  position: absolute;
  bottom: 0em;
  left: 2.5em;
  border-radius: 50%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5em;
}

.capylips {
  width: 0.25em;
  height: 0.75em;
  border-radius: 100%;
  transform: rotate(-45deg);
  background-color: var(--color);
}

.capylips:nth-child(2) {
  transform: rotate(45deg);
}

.capyeye {
  width: 2em;
  height: 0.5em;
  background-color: var(--color2);
  position: absolute;
  bottom: 3.5em;
  left: 1.5em;
  border-radius: 5em;
  transform: rotate(45deg);
}

.capyeye:nth-child(4) {
  transform: rotate(-45deg);
  left: 5.5em;
  width: 1.75em;
}

.capyleg {
  width: 6em;
  height: 5em;
  bottom: 0em;
  left: 0em;
  position: absolute;
  background: linear-gradient(var(--color), 95%, var(--color2));
  z-index: 2;
  border-radius: 2em;
  animation: movebody 1s linear infinite;
}

.capyleg2 {
  width: 1.75em;
  height: 3em;
  bottom: 0em;
  left: 3.25em;
  position: absolute;
  background: linear-gradient(var(--color), 80%, var(--color2));
  z-index: 2;
  border-radius: 0.75em;
  box-shadow: inset 0em -0.5em var(--color2);
  animation: moveleg 1s linear infinite;
}

.capyleg2:nth-child(3) {
  width: 1.25em;
  left: 0.5em;
  height: 2em;
  animation: moveleg2 1s linear infinite 0.075s;
}

@keyframes moveleg {
  0% {
    transform: rotate(-45deg) translateX(-5%);
  }

  50% {
    transform: rotate(45deg) translateX(5%);
  }

  100% {
    transform: rotate(-45deg) translateX(-5%);
  }
}

@keyframes moveleg2 {
  0% {
    transform: rotate(45deg);
  }

  50% {
    transform: rotate(-45deg);
  }

  100% {
    transform: rotate(45deg);
  }
}

@keyframes movebody {
  0% {
    transform: translateX(0%);
  }

  50% {
    transform: translateX(2%);
  }

  100% {
    transform: translateX(0%);
  }
}

.loaderline {
  width: 50em;
  height: 0.5em;
  border-top: 0.5em dashed var(--color2);
  animation: moveline 10s linear infinite;
}

@keyframes moveline {
  0% {
    transform: translateX(0%);
    opacity: 0%;
  }

  5% {
    opacity: 100%;
  }

  95% {
    opacity: 100%;
  }

  100% {
    opacity: 0%;
    transform: translateX(-70%);
  }
}

.capybaraloader.paused .capy,
.capybaraloader.paused .capyhead,
.capybaraloader.paused .capyleg,
.capybaraloader.paused .capyleg2,
.capybaraloader.paused .loaderline,
.capybaraloader-preview .capy,
.capybaraloader-preview .capyhead,
.capybaraloader-preview .capyleg,
.capybaraloader-preview .capyleg2,
.capybaraloader-preview .loaderline {
  animation-play-state: paused !important;
}

.top-nav .icon-btn {
  background: var(--segment-bg);
  border: 4px solid var(--segment-border);
  border-radius: 50%;
  width: 55px;
  height: 55px;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* =========================================
   CALENDAR OVERLAY (NOTION APPERTURE)
========================================= */

.calendar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-color);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  color: var(--theme-color);
  transition: opacity 0.3s ease;
}

.calendar-overlay.hidden {
  display: none !important;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.calendar-header h2 {
  font-size: 26px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
}

.cal-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 8px;
  border-radius: 8px;
}

.cal-close-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.calendar-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
  background: rgba(10, 10, 12, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.cal-days-header {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 0;
  background: rgba(255, 255, 255, 0.01);
}

.cal-days-header.month-header {
  grid-template-columns: repeat(7, 1fr);
}

.cal-day-label {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-day-label.today {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.cal-day-label.today span {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 6px;
  font-weight: 800;
}

.cal-grid-container-wrapper {
  display: flex;
  flex-grow: 1;
  overflow-y: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* iOS pinch zoom fix */
.calendar-body {
  touch-action: pan-x pan-y;
}

.calendar-body.pinching {
  touch-action: none;
}

.cal-time-col {
  width: 60px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.01);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.cal-time-label {
  height: 60px;
  text-align: right;
  padding-right: 12px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  font-weight: 500;
  transform: translateY(-7px);
}

.cal-grid {
  flex-grow: 1;
  position: relative;
  background: repeating-linear-gradient(to bottom,
      transparent,
      transparent 59px,
      rgba(255, 255, 255, 0.03) 59px,
      rgba(255, 255, 255, 0.03) 60px);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  cursor: crosshair;
}

.cal-grid-col {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  height: 1440px;
  /* 24 * 60px */
}

.cal-grid-col:last-child {
  border-right: none;
}

.cal-events-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  /* Let clicks pass to columns except on events */
}

.cal-event-block {
  position: absolute;
  background: #2b547e;
  border-radius: 4px;
  padding: 4px 8px;
  color: #fff;
  font-size: 12px;
  border-left: 3px solid #4abaff;
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.cal-event-block:hover {
  transform: scale(1.02);
  z-index: 10;
}

.cal-event-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.cal-current-time-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ff5e5e;
  z-index: 5;
  pointer-events: none;
}

.cal-current-time-label {
  position: absolute;
  left: -50px;
  top: -8px;
  color: #ff5e5e;
  font-size: 10px;
  font-weight: bold;
  background: var(--bg-color);
  padding: 0 4px;
  border-radius: 4px;
}

/* =========================================
   EVENT MODAL (NOTION STYLE NOTES)
========================================= */

.event-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 3000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.event-modal-content {
  background: #191919;
  border: 1px solid #333;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.event-modal-header {
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-modal-header h2 {
  font-size: 16px;
  color: #aaa;
  font-weight: 500;
}

.event-title-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  margin: 0 25px;
  padding: 10px 0;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  outline: none;
  font-family: inherit;
}

.event-title-input:focus {
  border-color: #4abaff;
}

.event-tabs {
  display: flex;
  gap: 20px;
  margin: 20px 25px 0 25px;
  border-bottom: 1px solid #333;
}

.event-tab-btn {
  background: transparent;
  border: none;
  color: #888;
  font-size: 14px;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 600;
  position: relative;
}

.event-tab-btn.active {
  color: #fff;
}

.event-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
}

.event-tab-pane {
  padding: 20px 25px;
  flex-grow: 1;
  overflow-y: auto;
  position: relative;
  min-height: 300px;
}

.event-notes-editable {
  min-height: 250px;
  color: #ddd;
  font-size: 15px;
  line-height: 1.6;
  outline: none;
}

.event-notes-editable[placeholder]:empty:before {
  content: attr(placeholder);
  color: #555;
  pointer-events: none;
}

.event-notes-editable h1 {
  margin: 15px 0 10px;
  font-size: 24px;
  color: #fff;
  font-weight: bold;
}

.event-notes-editable h2 {
  margin: 15px 0 10px;
  font-size: 20px;
  color: #fff;
  font-weight: bold;
}

.event-notes-editable h3 {
  margin: 12px 0 8px;
  font-size: 18px;
  color: #fff;
  font-weight: bold;
}

.event-notes-editable ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

.event-notes-editable li {
  margin-bottom: 5px;
}

.notion-todo {
  display: flex;
  align-items: flex-start;
  margin-bottom: 5px;
  gap: 10px;
}

.notion-todo input[type="checkbox"] {
  margin-top: 5px;
  accent-color: #4abaff;
}

.notion-todo-text {
  flex-grow: 1;
  outline: none;
}

/* Slash Menu Popover */
.slash-command-menu {
  position: fixed;
  background: #252525;
  border: 1px solid #444;
  border-radius: 8px;
  width: 280px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
}

.slash-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  gap: 15px;
  cursor: pointer;
  color: #ddd;
}

.slash-item:hover {
  background: #333;
}

.slash-item i {
  font-size: 20px;
  width: 24px;
  text-align: center;
  background: #fff;
  color: #000;
  border-radius: 4px;
  padding: 4px;
}

.slash-item div {
  display: flex;
  flex-direction: column;
}

.slash-item strong {
  font-size: 14px;
}

.slash-item span {
  font-size: 12px;
  color: #888;
}

/* Sketch Gallery View */
.sketch-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.sketch-add-btn {
  border: 2px dashed #444;
  border-radius: 12px;
  width: 140px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.sketch-add-btn:hover {
  border-color: #4abaff;
  background: rgba(74, 186, 255, 0.05);
}

.sketch-add-inner {
  text-align: center;
  color: #888;
}

.sketch-add-inner i {
  font-size: 24px;
  margin-bottom: 8px;
  color: #4abaff;
}

.sketch-card {
  width: 140px;
  height: 200px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #444;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.sketch-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}

.sketch-card-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.7);
  color: #ff5e5e;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.sketch-card:hover .sketch-card-delete {
  opacity: 1;
}

.event-modal-footer {
  padding: 15px 25px;
  background: #1e1e1e;
  border-top: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-save-btn {
  background: #fff;
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.event-footer-icons {
  display: flex;
  gap: 15px;
  color: #666;
  font-size: 18px;
}


/* =========================================
   CANVAS SKETCHER (GOODNOTES APPERTURE)
========================================= */

.canvas-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #121212;
  z-index: 4000;
  display: flex;
  flex-direction: column;
}

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}

.canvas-tools-left,
.canvas-tools-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.tool-btn {
  background: transparent;
  color: #aaa;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.tool-btn.active {
  background: #fff;
  color: #000;
}

.tool-btn.confirm {
  background: #4abaff;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
}

.pen-color-picker {
  border: none;
  background: none;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.pen-size-slider {
  width: 100px;
}

.canvas-workspace {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0f0f0f;
  padding: 20px;
  overflow: hidden;
}

#sketchCanvas {
  background: #111;
}

/* =========================================
   PHASE 2: MULTI-VIEW & DRAG EXPERIENCES
========================================= */

/* Header Controls */
.cal-header-left,
.cal-header-center,
.cal-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-header-left h2 {
  margin: 0;
}

.cal-header-center {
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px;
  border-radius: 8px;
}

.cal-nav-btn {
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 14px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
}

.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cal-view-select {
  background: #252525;
  color: #fff;
  border: 1px solid #444;
  padding: 6px 12px;
  border-radius: 6px;
  outline: none;
}

/* Event Dragging */
.cal-event-block {
  user-select: none;
}

.cal-event-block.dragging {
  opacity: 0.8;
  z-index: 100 !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  transition: none !important;
}

.event-resize-handle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  cursor: ns-resize;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.event-resize-handle::after {
  content: '';
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
}

.event-resize-handle:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Month View Layout Extras */
.month-view-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) !important;
  grid-auto-rows: minmax(100px, auto);
  overflow-y: auto;
  flex-grow: 1;
}

.month-day-cell {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px;
  min-height: 100px;
  position: relative;
}

.month-day-number {
  font-size: 12px;
  color: #888;
  margin-bottom: 5px;
  text-align: right;
  display: block;
}

.month-day-cell.today .month-day-number {
  color: #fff;
  background: #ff5e5e;
  float: right;
  padding: 2px 6px;
  border-radius: 50%;
  font-weight: bold;
}

.month-event-bar {
  background: #4abaff;
  color: #fff;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

/* Block Editor Interaction styling */
.event-notes-wrapper {
  position: relative;
  min-height: 250px;
}

.block-add-btn,
.block-drag-btn {
  position: absolute;
  left: -12px;
  background: transparent;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
  z-index: 10;
}

.block-drag-btn {
  left: -34px;
  cursor: grab;
}

.block-add-btn:hover,
.block-drag-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}

.block-add-btn.hidden,
.block-drag-btn.hidden {
  display: none !important;
}

.event-notes-editable {
  padding-left: 20px;
  /* Make room for floating handles */
}

/* Fix To-Do checkbox list explicitly */
.notion-todo-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 5px 0;
  padding: 2px 0;
}

.notion-todo-item[data-checked="true"] .todo-text {
  text-decoration: line-through;
  color: #666;
}

.todo-checkbox-btn {
  background: transparent;
  border: 1.5px solid #666;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-top: 4px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  color: transparent;
}

.notion-todo-item[data-checked="true"] .todo-checkbox-btn {
  background: #4abaff;
  border-color: #4abaff;
  color: white;
}

.todo-checkbox-btn i {
  font-size: 10px;
}

.todo-text {
  flex-grow: 1;
  outline: none;
  min-height: 24px;
}

/* =========================================
   PHASE 3: TRUE BLOCK EDITOR & DESTRUCTIVE ACTIONS
========================================= */

.event-delete-icon-btn {
  background: transparent;
  color: #ff5e5e;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 5px;
}

.event-delete-icon-btn.hidden {
  display: none !important;
}

.event-delete-icon-btn:hover {
  background: rgba(255, 94, 94, 0.1);
  border-radius: 4px;
}

.notion-block {
  min-height: 24px;
  outline: none;
  padding: 2px 0;
  position: relative;
  line-height: 1.5;
  color: #ddd;
}

.notion-block[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: #555;
  pointer-events: none;
  position: absolute;
  left: 0;
}

.notion-block.drag-over {
  border-top: 2px solid #4abaff;
}

.month-day-cell {
  cursor: pointer;
  transition: background 0.2s;
}

.month-day-cell:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Month Event Dot & Transitions */
.month-event-dot {
  background: #ffffff;
  color: #000;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
  font-weight: 600;
}

.month-event-dot:hover {
  transform: scale(1.03);
}

.cal-grid {
  animation: gridFadeIn 0.3s ease;
}

@keyframes gridFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =========================================
   RESPONSIVE DESIGN FOR IPAD & PHONE
========================================= */

@media (max-width: 900px) {
  .time-segment {
    width: 100px;
    height: 160px;
    font-size: 110px;
  }

  .segment-display__top {
    line-height: 160px;
  }

  .segment-overlay__top {
    line-height: 160px;
  }

  .time-colon {
    font-size: 80px;
    margin-bottom: 10px;
  }

  .task-tracker-wrapper {
    transform: scale(calc(var(--tracker-scale, 1) * 0.85));
  }

  .pomodoro-container {
    gap: 40px;
  }
}

@media (max-width: 600px) {
  .brand-logo {
    font-size: 20px;
    top: 15px;
    left: 15px;
  }

  .top-nav {
    top: 15px;
    right: 15px;
    gap: 10px;
  }

  .mode-toggles {
    padding: 6px 10px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    width: 90%;
  }

  .time-segment {
    width: 70px;
    height: 110px;
    font-size: 80px;
    border-width: 2px;
  }

  .segment-display__top {
    line-height: 110px;
  }

  .segment-overlay__top {
    line-height: 110px;
  }

  .time-colon {
    font-size: 50px;
    margin-bottom: 5px;
  }

  .countdown {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .time-group {
    gap: 4px;
  }

  .pomodoro-container {
    gap: 20px;
    width: 100%;
  }

  .modal-content {
    width: 90%;
    padding: 20px;
  }

  .task-panel {
    width: 90vw;
    bottom: 85px;
    right: 5vw;
    max-width: 320px;
  }

  .task-tracker-wrapper {
    transform: scale(calc(var(--tracker-scale, 1) * 0.75));
  }

  .floating-widget {
    width: 90%;
    left: 5%;
    bottom: 85px;
  }

  .animal-menu {
    width: 90%;
    right: 5%;
    bottom: 85px;
    max-width: 300px;
  }

  .calendar-overlay {
    padding: 40px 10px;
  }

  .calendar-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .cal-header-left h2 {
    font-size: 16px;
  }

  .cal-header-center,
  .cal-header-right {
    width: 100%;
    justify-content: space-between;
    gap: 5px;
    flex-wrap: wrap;
  }

  .cal-nav-btn {
    font-size: 12px;
    padding: 4px 8px;
  }

  .cal-view-select {
    font-size: 12px;
    padding: 4px 8px;
  }

  .event-modal-content {
    width: 95%;
    height: 90%;
    margin-top: 5vh;
  }
}

/* Display Mode Switcher & Resets */
.pomodoro-container {
  position: relative;
}

.display-mode-container {
  grid-column: 3;
  justify-self: start;
  margin-left: 24px;
  position: relative !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 50;
}

.display-mode-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.7;
  color: var(--theme-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.display-mode-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.display-mode-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px 0;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  min-width: 150px;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.display-mode-item {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
  transition: all 0.2s;
  text-align: left;
}

.display-mode-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.display-mode-item.active {
  color: #4abaff;
  font-weight: 700;
}

.reset-timer-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 8px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-color);
  transition: all 0.2s;
}

.reset-timer-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(-45deg);
}

/* Basic Clock Display */
.basic-time-display {
  font-size: 160px;
  font-weight: 900;
  color: var(--theme-color);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
  letter-spacing: -2px;
  font-family: var(--font-family);
  margin: 30px 0 15px;
  transition: opacity 0.35s ease;
  will-change: opacity;
}

.basic-time-display.digit-changing {
  opacity: 0.5;
}



/* Animation Clock Display */
.animation-circle-container {
  position: relative;
  width: 340px;
  height: 340px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
}

.progress-ring {
  transform: rotate(-90deg);
  position: absolute;
  top: 0;
  left: 0;
}

.progress-ring__circle {
  transition: stroke-dashoffset 1s linear;
}

.basic-time-small {
  font-size: 56px;
  font-weight: 700;
  color: var(--theme-color);
  z-index: 10;
  font-family: var(--font-family);
}

.running-hamster-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

/* Circle-orbiting hamster (no wheel) */
.circle-hamster {
  position: absolute;
  top: 0;
  left: 50%;
  transition: transform 1s linear;
}

.circle-hamster .hamster {
  position: relative;
  width: 7em;
  height: 3.75em;
  font-size: 14px;
  transform: translate(-50%, -30%) scale(0.65);
  animation: hamster var(--dur, 1s) ease-in-out infinite;
}

.circle-hamster .hamster__body,
.circle-hamster .hamster__head,
.circle-hamster .hamster__ear,
.circle-hamster .hamster__eye,
.circle-hamster .hamster__nose,
.circle-hamster .hamster__limb,
.circle-hamster .hamster__tail {
  position: absolute;
}

.circle-hamster.paused,
.circle-hamster.paused * {
  animation-play-state: paused !important;
}

/* Mode switch fade animation */
.clock-display>div:not(.hidden) {
  animation: modeFadeIn 0.35s ease;
  margin-bottom: 22px !important;
}

@keyframes modeFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* =========================================
   ANIMATION MODE (ZEN MODE)
========================================= */
body.animation-mode {
  overflow: hidden;
}



body.animation-mode .tracker-widget,
body.animation-mode .pet-close-btn,
body.animation-mode .show-pet-btn {
  opacity: 0 !important;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

body.animation-mode #animationClockDisplay {
  transform: scale(1.2);
  transition: transform 0.5s ease;
}



/* Hamster running in place (Animation Display) */
#animationClockDisplay .running-hamster-wrapper {
  --dur: 1s;
  font-size: 14px;
  /* Let base styles handle full overlay: position:absolute; top:0; left:0; width:100%; height:100% */
}

#animationClockDisplay .circle-hamster {
  position: absolute;
  top: 20px;
  /* 12 o'clock: cy(170) - r(150) = 20px */
  left: 170px;
  /* Horizontal center of 340px container */
  width: 7em;
  /* 98px */
  height: 3.75em;
  /* 52.5px */
  transform: translate(-50%, -50%) scale(0.55);
  transform-origin: center center;
  transition: none;
}

#animationClockDisplay .hamster {
  top: 0;
  left: 0;
  transform: none;
  animation: hamsterBounce var(--dur) ease-in-out infinite;
}

@keyframes hamsterBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

/* Digital Pomofox style text */
#animationClockDisplay .basic-time-small {
  font-size: 64px;
  font-family: 'Courier New', Courier, monospace;
  /* Digital look fallback */
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--theme-color);
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  margin-top: 20px;
}

/* =========================================
   FULLSCREEN ANIMATED BACKGROUND CANVAS
========================================= */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

body.scene-active {
  background-color: transparent !important;
}

body.scene-active .pomodoro-container {
  position: relative;
  z-index: 10;
}

body.scene-active .top-nav,
body.scene-active .brand-logo,
body.scene-active .task-tracker-wrapper,
body.scene-active .floating-widget,
body.scene-active .quote-display,
body.scene-active .ambience-panel {
  z-index: 100;
}

/* =========================================
   QUOTE DISPLAY (Subtle, non-distracting)
========================================= */
.quote-display {
  position: fixed;
  top: 65px;
  left: 24px;
  max-width: 400px;
  z-index: 15;
  text-align: left;
  pointer-events: none;
}

.quote-text {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  line-height: 1.5;
  letter-spacing: 0.03em;
  transition: opacity 2.5s ease-in-out;
  opacity: 1;
}

.quote-text.fading {
  opacity: 0;
}

/* =========================================
   AMBIENCE PANEL (Left Side)
========================================= */
.ambience-panel {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0;
}

.ambience-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ambience-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.08);
}

.ambience-toggle-btn.active {
  background: rgba(74, 186, 255, 0.15);
  border-color: rgba(74, 186, 255, 0.3);
  color: #4abaff;
}

.ambience-drawer {
  position: fixed;
  left: 80px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 500;
  background: rgba(10, 10, 12, 0.65);
  backdrop-filter: blur(25px) saturate(120%);
  -webkit-backdrop-filter: blur(25px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 20px 18px;
  min-width: 200px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  animation: ambienceSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ambience-drawer.hidden {
  display: none !important;
}

@keyframes ambienceSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.ambience-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ambience-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.ambience-item i {
  font-size: 14px;
  width: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s;
}

.ambience-item.active i {
  color: #4abaff;
}

.ambience-item span {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  width: 40px;
  flex-shrink: 0;
}

.ambience-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.ambience-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.ambience-slider::-webkit-slider-thumb:hover {
  background: #4abaff;
  transform: scale(1.2);
}

.ambience-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  border: none;
}

/* =========================================
   SCENE SELECTOR PANEL (Flocus-style)
========================================= */
.scene-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: rgba(14, 14, 14, 0.92);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  animation: scenePanelSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.scene-panel.hidden {
  display: none !important;
}

@keyframes scenePanelSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.scene-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.scene-panel-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scene-panel-header h2 i {
  color: #4abaff;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 20px 24px;
}

.scene-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: all 0.25s ease;
  background: rgba(255, 255, 255, 0.02);
}

.scene-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.scene-card.active {
  border-color: rgba(74, 186, 255, 0.5);
  background: rgba(74, 186, 255, 0.06);
  box-shadow: 0 0 20px rgba(74, 186, 255, 0.1);
}

.scene-preview-canvas {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  background: #0a0a0a;
  display: block;
}

.scene-preview-off {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  background: #1a1a1a;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 24px;
}

.scene-card span {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.02em;
}

.scene-card.active span {
  color: #4abaff;
}

/* Responsive adjustments for new panels */
@media (max-width: 600px) {
  .scene-panel {
    width: 100%;
  }

  .ambience-panel {
    left: 10px;
  }

  .ambience-drawer {
    min-width: 170px;
  }

  .quote-display {
    position: fixed;
    top: 65px;
    left: 24px;
    max-width: 400px;
    z-index: 15;
    text-align: left;
    pointer-events: none;
  }

  .quote-text {
    font-family: 'Satoshi', 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    line-height: 1.5;
    letter-spacing: 0.03em;
    transition: opacity 2.5s ease-in-out;
    opacity: 1;
  }
}




.scene-preview-img {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  display: block;
}

/* =========================================
   PREMIUM UPGRADE STYLES
========================================= */

/* Left Sidebar */
.left-sidebar {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 100;
}

.sidebar-item {
  position: relative;
}

.sidebar-btn {
  background: rgba(20, 20, 20, 0.45);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  width: 50px;
  height: 50px;
  border-radius: 25px;
  font-size: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.sidebar-btn:hover,
.sidebar-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Override old ambience drawer position */
.left-sidebar .ambience-drawer {
  top: 0;
  bottom: auto;
  left: 70px;
  transform: none;
}

/* Focus Stats Modal — old gradient styles removed, see SOLID BLACK FLIPCARD STYLE section below */

.session-tally-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
}

.active-task-display {
  display: flex;
  justify-content: center;
  margin-top: 5px;
  margin-bottom: 18px !important;
}

.active-task-text {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  text-align: center !important;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  font-size: clamp(1.6rem, 2.4vw, 2.7rem) !important;
  line-height: 1.18 !important;
}

/* Controls Row & Streak Position */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: nowrap;
  margin-top: 0 !important;
}

#startBtn { order: 1; }
#resetBtn { order: 2; }

.streak-indicator {
  order: 0;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.streak-indicator i {
  color: #ff6b35;
  font-size: 15px;
  filter: drop-shadow(0 0 4px rgba(255, 107, 53, 0.4));
}

.streak-indicator span {
  color: rgba(255, 255, 255, 0.7);
}

.streak-indicator.has-streak {
  color: rgba(255, 255, 255, 0.85);
}

.streak-indicator.has-streak i {
  animation: streakPulse 2s ease-in-out infinite;
}

@keyframes streakPulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 107, 53, 0.4)); }
  50% { filter: drop-shadow(0 0 8px rgba(255, 107, 53, 0.7)); }
}

.session-counter-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.tally-icon {
  font-size: clamp(1.35rem, 1.6vw, 1.8rem) !important;
  line-height: 1 !important;
  opacity: 0.4 !important;
  filter: grayscale(0.25) brightness(0.8);
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease, text-shadow 0.2s ease;
}

.tally-icon.active {
  opacity: 1 !important;
  filter: none;
  transform: scale(1.12);
  text-shadow: 0 0 10px rgba(255,255,255,0.25);
}

.tally-icon.completed {
  opacity: 0.35 !important;
  transform: scale(0.9);
}

@keyframes pulseEmoji {
  0% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  }

  50% {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
  }

  100% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  }
}

.emoji-picker-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 5px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.emoji-picker-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.emoji-picker-popup {
  position: absolute;
  top: 50px;
  background: rgba(20, 20, 22, 0.85);
  backdrop-filter: blur(25px) saturate(150%);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 15px;
  z-index: 200;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: max-content;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.emoji-opt {
  font-size: 24px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-opt:hover,
.emoji-opt.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}



/* =========================================
   VIDEO BACKGROUND
========================================= */
.video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
  pointer-events: none;
}

.video-bg:not(.hidden) {
  display: block !important;
}

.video-bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
  z-index: -1;
  pointer-events: none;
}

/* =========================================
   ANIMATED TABS SECTION
========================================= */
.animated-tabs-grid .scene-card {
  position: relative;
}

.animated-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #fff;
  font-size: 18px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  opacity: 0.8;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.animated-tab:hover .animated-badge {
  opacity: 1;
}

.animated-tab.active .animated-badge {
  color: #a855f7;
  opacity: 1;
}

/* =========================================
   CUSTOM BACKGROUND UPLOAD
========================================= */
.custom-upload-section {
  padding: 15px 20px;
}

.custom-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #ccc;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-family);
}

.custom-upload-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.custom-upload-btn i {
  font-size: 18px;
}

/* =========================================
   YOUTUBE PIP WIDGET
========================================= */
.youtube-pip-widget {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 380px;
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  z-index: 200;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.youtube-pip-widget:not(.hidden) {
  display: block !important;
}

.youtube-pip-widget.fullscreen-mode {
  width: 90vw;
  height: 85vh;
  top: 5vh;
  left: 5vw;
  bottom: auto;
  right: auto;
  border-radius: 20px;
}

.youtube-pip-widget.fullscreen-mode .yt-pip-player {
  height: calc(100% - 20px);
  min-height: 100%;
}

.youtube-pip-widget.fullscreen-mode .yt-pip-body {
  height: calc(100% - 50px);
}

.youtube-pip-widget.fullscreen-mode .yt-pip-player iframe {
  height: calc(100% + 40px);
}

.youtube-pip-widget.minimized {
  width: 200px;
  height: auto;
}

.youtube-pip-widget.minimized .yt-pip-body {
  display: none;
}

.yt-pip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: grab;
  user-select: none;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.yt-pip-header:active {
  cursor: grabbing;
}

.yt-pip-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #ff0000;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.yt-pip-controls {
  display: flex;
  gap: 6px;
}

.yt-pip-btn {
  background: transparent;
  border: none;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.yt-pip-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.yt-pip-body {
  padding: 14px 16px;
}

.yt-pip-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.yt-pip-input-group input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease;
}

.yt-pip-input-group input:focus {
  border-color: #ff0000;
}

.yt-pip-input-group button {
  background: #ff0000;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  transition: all 0.2s ease;
}

.yt-pip-input-group button:hover {
  background: #cc0000;
}

.yt-pip-player {
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  min-height: 200px;
  position: relative;
}

.yt-pip-player iframe {
  width: 100%;
  height: 240px;
  border: none;
  transform: translateY(0);
  margin-bottom: -40px;
  transition: transform 0.3s ease;
  pointer-events: auto;
}

.yt-pip-player:hover iframe {
  transform: translateY(-40px);
}

.yt-pip-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  color: #555;
}

.yt-pip-placeholder i {
  font-size: 40px;
  opacity: 0.4;
}

.yt-pip-placeholder span {
  font-size: 13px;
}

.yt-change-link {
  padding: 4px 0;
  margin-bottom: 8px;
}

.yt-change-link .yt-pip-btn {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #888;
}

.yt-pip-input-group.hidden,
.yt-change-link.hidden {
  display: none !important;
}

/* =========================================
   ALERT DRAWER IN TOP-NAV
========================================= */
.top-nav-alert {
  position: relative;
  display: inline-flex;
}

.top-nav-alert .ambience-drawer {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin-top: 10px;
  min-width: 240px;
  z-index: 100;
}

/* =========================================
   PET RESIZE HANDLE
========================================= */
.pet-resize-handle {
  position: absolute;
  bottom: -6px;
  left: -6px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: nwse-resize;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  z-index: 10;
  transition: all 0.2s ease;
  opacity: 0;
}

.tracker-widget:hover .pet-resize-handle {
  opacity: 1;
}

.pet-resize-handle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

/* =========================================
   STAT CARDS — SOLID BLACK FLIPCARD STYLE
========================================= */
.stats-modal-content {
  width: 600px;
  max-width: 95vw;
  background: rgba(15, 15, 20, 0.92) !important;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.stats-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.stats-tab {
  background: transparent;
  border: 1px solid #333;
  color: #888;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-family);
  transition: all 0.2s ease;
}

.stats-tab:hover {
  color: #fff;
  border-color: #555;
}

.stats-tab.active {
  background: #fff;
  color: #000;
  border-color: transparent;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: #000;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 18px;
  border-left: 4px solid #555;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: #555;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.stat-card .stat-header {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card .stat-header i {
  font-size: 13px;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  font-family: var(--font-family);
}

.stat-card .stat-value.blur-val {
  filter: blur(4px);
  user-select: none;
}

/* Accent colors per card type */
.stat-card.streak {
  border-left-color: #ff6b35;
}

.stat-card.time {
  border-left-color: #4abaff;
}

.stat-card.score {
  border-left-color: #a855f7;
}

.stat-card.tasks {
  border-left-color: #22c55e;
}

.stat-card.sessions {
  border-left-color: #eab308;
}

.stat-card.break {
  border-left-color: #f472b6;
}

/* =========================================
   STREAK UI — MATCH START BUTTON THEME
========================================= */
.stat-card.streak .stat-value {
  color: #fff;
  font-weight: 900;
}

.stat-card.streak .stat-header {
  color: #ff6b35;
}

.stat-card.streak .stat-header i {
  color: #ff6b35;
}

/* =========================================
   STATS CHART
========================================= */
.stats-chart-container {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #222;
}

.stats-chart-container h3 {
  font-size: 14px;
  font-weight: 600;
  color: #888;
  margin-bottom: 12px;
}

.chart-area {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  padding: 15px;
}

/* =========================================
   MOBILE STATS CLOSE BUTTON
========================================= */
.mobile-stats-close {
  display: none;
}

/* =========================================
   NOTES DROPDOWN
========================================= */
.note-list-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 250px;
  background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 15px;
  margin-top: 10px;
  z-index: 200;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.note-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

#createNewNoteBtn {
  background: #a855f7;
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

#noteListContainer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

/* =========================================
   FLOATING WIDGETS
========================================= */
.floating-widget {
  position: fixed;
  background: rgba(15, 15, 20, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 15px;
  z-index: 1000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  min-width: 280px;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  cursor: move;
}

.widget-header h3 {
  font-size: 14px;
  color: #4abaff;
  margin: 0;
}

.widget-tool-btn {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
}

.local-time-display {
  font-size: 42px;
  font-weight: 900;
  text-align: center;
  font-family: 'Roboto Mono', monospace;
  margin: 5px 0;
}

.local-date-display {
  font-size: 13px;
  color: #888;
  text-align: center;
}

.floating-widget.collapsed .widget-body {
  display: none;
}

/* =========================================
   MOBILE RESPONSIVE RULES
========================================= */
@media (max-width: 768px) {
  .top-nav {
    top: max(15px, env(safe-area-inset-top));
    right: max(15px, env(safe-area-inset-right));
  }

  .brand-logo {
    top: max(15px, env(safe-area-inset-top));
    left: max(15px, env(safe-area-inset-left));
  }
}

@media (max-width: 600px) {
  /* Global safe areas */
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Stats Modal */
  .stats-modal-content {
    width: 95vw;
    max-height: 85dvh;
    overflow-y: auto;
    padding: clamp(15px, 4vw, 25px);
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .mobile-stats-close {
    display: block;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    font-size: 24px;
  }

  /* Scene panel - Bottom Sheet style */
  .scene-panel {
    width: 100vw !important;
    height: 70vh !important;
    bottom: 0 !important;
    top: auto !important;
    right: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    transform: translateY(0) !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .scene-panel.hidden {
    transform: translateY(100%) !important;
    display: block !important;
  }

  /* Left sidebar → left-middle vertical column */
  .left-sidebar {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
    right: auto;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    gap: 10px;
    z-index: 150;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: none;
  }

  .left-sidebar .sidebar-item {
    margin-bottom: 0;
  }

  /* Drawers slide in from the left side */
  .more-menu-drawer,
  .ambience-drawer,
  .note-list-dropdown {
    position: fixed !important;
    left: 64px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    width: calc(100vw - 84px) !important;
    max-width: 320px;
    padding: 16px !important;
    gap: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    background: rgba(15, 15, 15, 0.97) !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 40px rgba(0,0,0,0.8) !important;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 2000 !important;
    animation: slideSidebarDrawer 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .note-list-dropdown.hidden {
    display: none !important;
  }

  @keyframes slideSidebarDrawer {
    from { opacity: 0; transform: translateY(-50%) translateX(-10px); }
    to   { opacity: 1; transform: translateY(-50%) translateX(0);     }
  }

  /* Companion picker — always visible above focus widget on mobile */
  .companion-picker {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    bottom: 260px !important;
    top: auto !important;
  }
  .companion-picker-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .ambience-drawer .ambience-item {
    flex-direction: row !important;
    gap: 12px !important;
    padding: 10px !important;
    min-width: 0;
    align-items: center;
    width: 100%;
    justify-content: space-between;
  }

  .ambience-drawer .ambience-item span {
    flex: 1;
    font-size: 14px;
    text-align: left;
  }

  .ambience-drawer .ambience-slider {
    width: 120px !important;
  }

  .more-menu-drawer.hidden,
  .ambience-drawer.hidden {
    display: none !important;
  }

  /* Mode selector horizontal force */
  .mode-toggles {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 4px !important;
    border-radius: 12px !important;
    background: rgba(0,0,0,0.4) !important;
  }

  .mode-btn {
    flex: 1;
    white-space: nowrap;
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  /* Pet tracker */
  .task-tracker-wrapper {
    bottom: calc(65px + env(safe-area-inset-bottom));
    right: 15px;
    transform: scale(0.7);
    transform-origin: bottom right;
  }

  /* YouTube PiP */
  .youtube-pip-widget {
    width: clamp(260px, 80vw, 320px);
    bottom: calc(75px + env(safe-area-inset-bottom));
    left: 10px;
  }

  /* Spotify Widget */
  .floating-widget {
    width: 95vw !important;
    left: 2.5vw !important;
    top: auto !important;
    bottom: calc(75px + env(safe-area-inset-bottom)) !important;
    padding: 15px !important;
  }

  .yt-pip-player {
    min-height: 150px;
  }

  .yt-pip-player iframe {
    height: 150px;
  }

  /* Timer Controls scaling */
  .start-btn {
    padding: 12px 40px;
    font-size: 18px;
    min-height: 44px;
  }

  .controls-row {
    gap: 12px;
  }

  /* Flipclock responsive - Scaled for 375px+ */
  .time-segment {
    font-size: clamp(40px, 15vw, 80px);
    width: clamp(35px, 12vw, 60px);
    height: clamp(55px, 20vw, 95px);
  }

  .segment-display__top, 
  .segment-overlay__top {
    line-height: clamp(55px, 20vw, 95px);
  }

  .time-colon {
    font-size: clamp(24px, 10vw, 40px);
  }

  .countdown {
    gap: clamp(4px, 2vw, 8px);
  }

  .time-group {
    gap: clamp(2px, 1vw, 4px);
  }

  /* Task Panel */
  .task-panel {
    width: 95vw !important;
    left: 2.5vw !important;
    max-height: 80vh !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }

  /* Hamster Focus Animation */
  .wheel-and-hamster {
    font-size: 10px !important; /* Scale down via font-size em units */
  }

  /* Calendar Responsive */
  .calendar-overlay {
    padding: 10px !important;
  }

  .calendar-header h2 {
    font-size: 18px !important;
  }

  .cal-days-header {
    grid-template-columns: 40px repeat(7, 1fr) !important;
  }

  .cal-days-header.month-header {
    grid-template-columns: repeat(7, 1fr) !important;
  }

  .cal-day-label {
    font-size: 10px !important;
  }

  .cal-time-col {
    width: 40px !important;
  }

  .cal-grid {
    grid-template-columns: repeat(7, 1fr) !important;
  }

  /* Scene panel grid */
  .scene-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 12px !important;
  }
}

/* Specific micro-adjustments for very narrow screens */
@media (max-width: 600px) {
  .modal-content {
    width: 95vw !important;
    padding: 20px !important;
    max-height: 90dvh;
    overflow-y: auto;
  }
}

@media (max-width: 380px) {
  .mode-toggles {
    gap: 5px;
    padding: 4px 6px;
  }
  
  .mode-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .time-segment {
    width: 32px;
    height: 50px;
    font-size: 36px;
  }
  
  .segment-display__top, 
  .segment-overlay__top {
    line-height: 50px;
  }
}

@media (max-width: 768px) {

  /* Video bg fallback — use poster on mobile for performance */
  .video-bg {
    display: none !important;
  }
}

/* =========================================
   NOTE PANEL (GOODNOTES/NOTION STYLE)
========================================= */
.note-panel {
  position: fixed;
  top: 10vh;
  left: 10vw;
  width: 80vw;
  height: 80vh;
  background: rgba(18, 18, 20, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  z-index: 500;
  display: flex;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  font-family: var(--font-family);
}

.note-panel.hidden {
  display: none !important;
}

.note-sidebar {
  width: 250px;
  background: rgba(0, 0, 0, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
}

.note-sidebar-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.note-sidebar-header h3 {
  font-size: 16px;
  margin: 0;
  color: #fff;
  font-weight: 600;
}

.note-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.note-list-item {
  padding: 12px 15px;
  border-radius: 8px;
  cursor: pointer;
  color: #aaa;
  font-size: 14px;
  margin-bottom: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.note-list-item.active {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  font-weight: 600;
}

.note-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.note-header {
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.note-title-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-family);
  outline: none;
  width: 50%;
}

.note-title-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.note-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: #888;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.tool-btn.active {
  background: #a855f7;
  color: #fff;
  border-color: #a855f7;
}

.note-workspace {
  flex: 1;
  position: relative;
  overflow-y: auto;
  padding: 30px;
}

.note-text-editor {
  min-height: 100%;
  outline: none;
  color: #eee;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  position: relative;
  z-index: 1;
}

.note-text-editor:empty:before {
  content: attr(placeholder);
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
  display: block;
}

.note-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  cursor: crosshair;
}

@media (max-width: 768px) {
  .note-panel {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    flex-direction: column;
  }

  .note-sidebar {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .note-title-input {
    font-size: 18px;
    width: 40%;
  }
}

@media (max-width: 600px) {
  .active-task-text {
    font-size: clamp(1.25rem, 5vw, 1.8rem) !important;
  }

  .active-task-display {
    margin-bottom: 12px !important;
  }

  .mode-toggles {
    margin-bottom: 18px !important;
  }

  .clock-display > div:not(.hidden) {
    margin-bottom: 14px !important;
  }

  .session-tally-container {
    gap: 10px;
    margin: 14px 0 10px 0 !important;
    margin-bottom: 12px !important;
  }

  .tally-icon {
    font-size: 1.25rem !important;
  }

  .controls-row {
    gap: 10px;
  }

  .streak-indicator {
    font-size: 0.9rem;
  }
}

/* =========================================
   PAGE SYSTEM
========================================= */
.app-page {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto !important;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.app-page.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(20px);
}

.page-nav {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px;
  border-radius: 30px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: auto;
}

.page-nav--hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}

.nav-item {
  background: transparent;
  border: none;
  color: #888;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-family);
  transition: all 0.3s ease;
}

.nav-item:hover {
  color: #fff;
}

.nav-item.active {
  background: #fff;
  color: #000;
}

/* =========================================
   HOME PAGE STYLES
========================================= */
#homePage {
  padding: 80px 20px;
  justify-content: flex-start;
}

.home-hero {
  text-align: center;
  margin-top: 10vh;
  margin-bottom: 80px;
  max-width: 800px;
}

.motivational-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 8vw, 48px);
  font-weight: 400;
  font-style: italic;
  color: #fff;
  margin-bottom: clamp(20px, 5vh, 40px);
  line-height: 1.2;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  padding: 0 20px;
}

.home-clock-container {
  margin-bottom: 50px;
}

.home-clock-label {
  font-size: 14px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
  font-weight: 600;
}

.cta-button {
  background: #fff;
  color: #000;
  border: none;
  padding: 18px 45px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.home-info-section {
  max-width: 900px;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 60px;
  margin-top: 40px;
  backdrop-filter: blur(10px);
}

.info-content h2 {
  font-size: 32px;
  margin-bottom: 20px;
  font-weight: 700;
}

.info-content p {
  font-size: 18px;
  line-height: 1.6;
  color: #ccc;
  margin-bottom: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.feature-item i {
  font-size: 24px;
  color: #a855f7;
  margin-bottom: 15px;
}

.feature-item h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.feature-item p {
  font-size: 14px;
  color: #888;
  margin-bottom: 0;
}

.developer-note {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 40px;
}

.developer-note h3 {
  font-size: 20px;
  margin-bottom: 15px;
  font-weight: 600;
}

.developer-note p {
  font-style: italic;
  font-size: 16px;
  color: #aaa;
}

/* =========================================
   REALTIME FLIP CLOCK
========================================= */
.realtime-flipclock {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.realtime-flipclock.small .time-segment {
  width: 80px;
  height: 120px;
  font-size: 80px;
}

.realtime-flipclock.small .segment-display__top,
.realtime-flipclock.small .segment-overlay__top {
  line-height: 120px;
}

.realtime-flipclock.small .time-colon {
  font-size: 60px;
}

/* =========================================
   COLLAPSIBLE SIDEBAR & MORE MENU
========================================= */
.collapsible-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.more-menu-item {
  position: relative;
}

.more-menu-drawer {
  position: fixed;
  left: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.more-menu-drawer .sidebar-btn {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

/* =========================================
   FOCUS REALTIME CLOCK OVERLAY
========================================= */
.focus-realtime-clock {
  position: fixed;
  top: 100px;
  right: 30px;
  text-align: right;
  z-index: 90;
  background: rgba(0, 0, 0, 0.3);
  padding: 15px 15px 12px 15px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.focus-clock-close {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.focus-clock-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.logo-img {
  width: 32px;
  height: 32px;
  margin-right: 10px;
  object-fit: contain;
}

.brand-logo {
  display: flex;
  align-items: center;
}

/* =========================================
   FOCUS WORLD COMPANION WIDGET
========================================= */
.focus-world-wrapper {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: stretch;
  z-index: 100;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.focus-world-card {
  position: relative;
  width: 520px;
  height: 172px;
  overflow: hidden;
  background: #0c0c14;
  flex-shrink: 0;
}

.focus-world-header {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 4;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.focus-world-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.focus-world-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0%,
    transparent 45%,
    rgba(0, 0, 0, 0.15) 100%
  );
  z-index: 2;
}

.cat-companion {
  position: absolute;
  bottom: 4px;
  left: 0;
  height: 108px;        /* zoomed up from 78px */
  width: auto;
  z-index: 3;
  pointer-events: none;
  image-rendering: auto;
  transition: none;
  /* clip the bottom ~16px where Chinese watermark lives */
  clip-path: inset(0 0 16px 0);
}
/* Per-companion vertical tweaks */
#catCompanion[data-companion="girl"] {
  bottom: -8px;
}

/* Loading shimmer — shown while companion frames download */
.focus-world-card.fw-companion-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: fw-shimmer 1.2s ease-in-out infinite;
}

@keyframes fw-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.fw-session-bar-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 4;
}

.fw-session-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  transition: width 0.5s ease;
}

/* Focus Level vertical card */
.focus-level-card {
  width: 98px;
  flex-shrink: 0;
  background: rgba(8, 8, 18, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 14px;
}

.focus-level-title {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.focus-level-badge {
  background: linear-gradient(135deg, #6d28d9, #a855f7);
  border-radius: 9px;
  padding: 4px 7px;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.25;
  letter-spacing: 0.3px;
}

.focus-level-badge span {
  display: block;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.focus-xp-text {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  line-height: 1.4;
}

.focus-xp-bar-wrap {
  flex: 1;
  width: 12px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  overflow: hidden;
  margin: 5px 0;
  display: flex;
  align-items: flex-end;
  min-height: 40px;
}

.focus-xp-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, #6d28d9, #a855f7);
  border-radius: 6px;
  transition: height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  min-height: 2px;
}

.focus-gem-icon {
  font-size: 16px;
  opacity: 0.8;
}

/* Paw button (change companion) */
.change-companion-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(109, 40, 217, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  padding: 3px 9px 3px 7px;
  color: rgba(255, 255, 255, 0.75);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
  white-space: nowrap;
}
.change-companion-btn::before {
  content: '🐾';
  font-size: 12px;
}
.change-companion-btn:hover {
  background: rgba(109, 40, 217, 0.5);
  border-color: rgba(168, 85, 247, 0.7);
  color: #fff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
  transform: scale(1.05);
}
.change-companion-btn:active {
  transform: scale(0.97);
}

/* Companion picker popup */
.companion-picker {
  position: fixed;
  z-index: 300;
  background: rgba(10, 10, 22, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.7);
}
.companion-picker.hidden { display: none; }

.companion-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.companion-pick-btn {
  width: 76px;
  height: 54px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.1s;
  padding: 0;
}
.companion-pick-btn:hover {
  border-color: rgba(168, 85, 247, 0.55);
  transform: scale(1.04);
}
.companion-pick-btn.active {
  border-color: #a855f7;
  box-shadow: 0 0 0 1px #a855f7 inset;
}

.cpb-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  padding: 2px 3px 3px;
  letter-spacing: 0.2px;
}

/* Skeleton state — companion frames not yet cached */
.companion-pick-btn.cpb-loading {
  background-image: none !important;
  background-color: rgba(255, 255, 255, 0.04);
  animation: cpb-pulse 1.4s ease-in-out infinite;
  cursor: wait;
}
.companion-pick-btn.cpb-loading .cpb-name {
  background: rgba(255, 255, 255, 0.08);
  color: transparent;
  border-radius: 0 0 8px 8px;
}

/* Spinner dot in centre of skeleton card */
.cpb-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -62%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(168, 85, 247, 0.25);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: cpb-spin 0.8s linear infinite;
}

@keyframes cpb-pulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 0.9;  }
}
@keyframes cpb-spin {
  to { transform: translate(-50%, -62%) rotate(360deg); }
}

/* Mobile adjustments — compact companion so Start button stays reachable */
@media (max-width: 768px) {
  .focus-world-wrapper {
    left: 10px;
    bottom: 10px;
    flex-direction: row;
    border-radius: 12px;
    transform-origin: bottom left;
  }
  .focus-world-card {
    width: min(200px, calc(100vw - 116px));
    height: 72px;
  }
  .focus-world-header {
    top: 6px;
    left: 8px;
    right: 8px;
    font-size: 10px;
  }
  .focus-level-card {
    width: 80px;
    flex-direction: column;
    height: 72px;
    padding: 6px 6px 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    border-top: none;
    justify-content: space-between;
  }
  .focus-level-title { font-size: 8px; }
  .focus-xp-bar-wrap {
    flex: 1;
    width: 10px;
    height: auto;
    min-height: 20px;
    align-items: flex-end;
    flex-direction: column;
  }
  .focus-xp-fill {
    height: 0%;
    width: 100%;
    background: linear-gradient(to top, #6d28d9, #a855f7);
    transition: height 0.5s ease;
  }
  .cat-companion {
    height: 62px;
    clip-path: inset(0 0 10px 0);
  }
  .change-companion-btn {
    font-size: 8px;
    padding: 2px 5px 2px 4px;
  }
  .change-companion-btn::before { font-size: 10px; }
}

@media (max-width: 768px) {
  .motivational-text {
    font-size: clamp(24px, 6vw, 32px);
  }
  .home-info-section {
    padding: 20px;
  }
  .page-nav {
    bottom: max(15px, env(safe-area-inset-bottom));
  }
  .focus-realtime-clock {
    top: auto;
    bottom: calc(100px + env(safe-area-inset-bottom));
    right: 15px;
    padding: 10px;
    transform: scale(0.85);
    transform-origin: bottom right;
  }
  .home-hero {
    margin-top: 5vh;
    margin-bottom: 40px;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .realtime-flipclock.small .time-segment {
    width: clamp(45px, 18vw, 80px) !important;
    height: clamp(70px, 28vw, 120px) !important;
    font-size: clamp(45px, 18vw, 80px) !important;
  }
  .realtime-flipclock.small .segment-display__top,
  .realtime-flipclock.small .segment-overlay__top {
    line-height: clamp(70px, 28vw, 120px) !important;
  }
  .realtime-flipclock {
    gap: 10px;
  }
}

/* =========================================
   MOBILE REFINEMENTS — targeted fixes
========================================= */

/* 1. Shrink top-nav icon buttons on mobile to prevent layout crowding */
@media (max-width: 600px) {
  .top-nav .icon-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-width: 3px;
  }
}

/* 2. Focus page: extra bottom padding so info section clears nav + companion */
@media (max-width: 600px) {
  #focusPage {
    padding-bottom: calc(220px + env(safe-area-inset-bottom));
  }
}

/* 3. Month view: reduce cell min-height on mobile so the full month fits */
@media (max-width: 600px) {
  .month-view-grid {
    grid-auto-rows: minmax(60px, auto) !important;
  }
  .month-day-number {
    font-size: 11px;
  }
}

/* 4. Note panel: reduce sidebar strip height on small screens */
@media (max-width: 600px) {
  .note-sidebar {
    height: 150px;
    min-height: 0;
  }
}

/* 5. Ultra-narrow screens (≤360px) */
@media (max-width: 360px) {
  .top-nav {
    gap: 6px;
  }
  .top-nav .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-width: 2px;
  }
  .brand-logo {
    font-size: 17px;
  }
}

/* ==========================================
   QUEST LAYER — Quest Log · Focus Score · Breaks
   ========================================== */

/* ---- Quest sidebar button — special accent ---- */
.quest-sidebar-btn {
  position: relative;
}

.quest-sidebar-btn::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.quest-sidebar-btn.active::after,
.quest-sidebar-btn:hover::after {
  opacity: 1;
}

/* ---- Compact Quest HUD (near timer) ---- */
.fq-quest-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 0 10px;
  cursor: pointer;
  user-select: none;
}

.fq-compact-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.fq-compact-icon {
  font-size: 12px;
  color: rgba(168, 85, 247, 0.6);
  opacity: 0.7;
}

.fq-compact-quest {
  font-family: 'Sora', sans-serif;
  font-size: clamp(50px, 2.5vw, 25px);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  max-width: 55vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fq-compact-quest--empty {
  color: rgba(255, 255, 255, 0.28);
  font-style: italic;
}

.fq-compact-meta {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.04em;
}

/* ---- Quest Log Panel ---- */
.fq-quest-panel {
  position: fixed;
  left: 90px;
  top: 50%;
  transform: translateY(-50%);
  width: 340px;
  max-height: 86vh;
  overflow-y: auto;
  background: rgba(10, 10, 13, 0.94);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px;
  z-index: 300;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  font-family: var(--font-family);
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.fq-quest-panel.hidden {
  display: none;
}

.fq-quest-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.fq-quest-panel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fq-quest-panel-icon {
  font-size: 18px;
  color: rgba(168, 85, 247, 0.7);
  flex-shrink: 0;
}

.fq-quest-panel-date {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.fq-quest-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  letter-spacing: 0.03em;
}

.fq-quest-close-btn {
  width: 26px !important;
  height: 26px !important;
  font-size: 12px !important;
  border-width: 1px !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  flex-shrink: 0;
}

/* Quest Log Sections */
.fq-ql-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fq-ql-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fq-ql-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.25);
}

/* Main Quest Input */
.fq-main-quest-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-family);
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.fq-main-quest-input:focus {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.1);
}

.fq-main-quest-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 400;
}

/* Shared Textarea */
.fq-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-family: var(--font-family);
  line-height: 1.6;
  padding: 9px 12px;
  outline: none;
  resize: vertical;
  min-height: 64px;
  max-height: 140px;
  transition: border-color 0.2s ease;
}

.fq-textarea:focus {
  border-color: rgba(168, 85, 247, 0.28);
}

.fq-textarea::placeholder {
  color: rgba(255, 255, 255, 0.14);
}

/* Focus Score Section */
.fq-score-section {
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.12);
  border-radius: 14px;
  padding: 14px;
  gap: 10px;
}

.fq-score-bar-wrap {
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: hidden;
}

.fq-score-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease, background 0.5s ease;
  width: 0%;
}

.fq-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fq-score-num {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  font-family: var(--font-family);
  min-width: 52px;
}

.fq-score-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.25);
  margin-bottom: 3px;
}

.fq-score-rank {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.4s ease;
}

/* ---- Goal subtitle (hidden element kept for compatibility) ---- */
.fq-goal-subtitle {
  display: none;
}

/* ---- Progress Ring ---- */
.fq-prog-ring-wrap {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.fq-prog-ring-wrap svg {
  transform: rotate(-90deg);
  display: block;
}

.fq-prog-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.fq-prog-fill {
  stroke: rgba(168, 85, 247, 0.7);
  transition: stroke-dasharray 0.45s ease;
}

.fq-prog-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

/* ---- Focus Task List ---- */
.fq-task-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fq-task-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.fq-task-item.done {
  opacity: 0.38;
}

.fq-task-item.done .fq-task-text {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.25);
}

.fq-task-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}

@media (pointer: coarse) {
  .fq-task-check { min-height: 44px; }
}

.fq-task-item.done .fq-task-check {
  background: rgba(168, 85, 247, 0.55);
  border-color: rgba(168, 85, 247, 0.75);
  color: #fff;
}

.fq-task-text {
  flex: 1;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  outline: none;
  border-radius: 4px;
  cursor: text;
  padding: 1px 3px;
  margin: -1px -3px;
  transition: background 0.15s ease;
}

.fq-task-text:focus {
  background: rgba(255, 255, 255, 0.06);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.fq-task-del {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  font-size: 10px;
  padding: 4px 6px;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.fq-task-item:hover .fq-task-del {
  opacity: 1;
}

@media (pointer: coarse) {
  .fq-task-del { opacity: 0.5; }
}

.fq-task-del:hover {
  color: rgba(255, 80, 80, 0.8);
}

/* Task Add Input */
.fq-task-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-family: var(--font-family);
  padding: 8px 12px;
  outline: none;
  margin-top: 4px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.fq-task-input:focus {
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.fq-task-input::placeholder {
  color: rgba(255, 255, 255, 0.14);
}

/* ---- Task Animations ---- */
.fq-task-enter {
  opacity: 0;
  transform: translateY(-6px);
}

.fq-task-leave {
  opacity: 0 !important;
  transform: translateX(8px) !important;
}

@keyframes fq-check-bounce {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.45); }
  100% { transform: scale(1); }
}

.fq-check-bounce {
  animation: fq-check-bounce 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fq-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-4px); }
  60%       { transform: translateX(4px); }
  80%       { transform: translateX(-3px); }
}

.fq-shake {
  animation: fq-shake 0.4s ease;
}

/* ---- Quest Complete Celebration ---- */
@keyframes fq-day-glow-pulse {
  0%, 100% { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65); }
  50%       { box-shadow: 0 24px 70px rgba(168, 85, 247, 0.3), 0 0 32px rgba(168, 85, 247, 0.15); }
}

.fq-quest-panel.fq-day-glow {
  animation: fq-day-glow-pulse 0.9s ease-in-out 3;
}

.fq-day-cleared-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.38);
  color: rgba(168, 85, 247, 0.9);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 8px 18px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  animation: fq-cleared-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 20;
}

@keyframes fq-cleared-pop {
  from { opacity: 0; transform: translate(-50%, -44%) scale(0.75); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---- Stats Modal Score Card ---- */
.fq-score-stat-card {
  grid-column: 1 / -1;
  border-left-color: rgba(168, 85, 247, 0.6) !important;
}

.fq-score-stat-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 4px;
}

.stat-rank {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 0.5s ease;
}

@keyframes fq-rank-glow-pulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35); }
  50%      { box-shadow: 0 4px 28px rgba(168, 85, 247, 0.45), 0 0 14px rgba(168, 85, 247, 0.2); }
}

.fq-rank-glow {
  animation: fq-rank-glow-pulse 0.9s ease-in-out 2;
}

/* ---- Score Float ---- */
.fq-score-floats {
  position: fixed;
  bottom: 110px;
  right: 35px;
  pointer-events: none;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.fq-score-float {
  font-size: 12px;
  font-weight: 700;
  color: rgba(168, 85, 247, 0.9);
  white-space: nowrap;
  opacity: 0;
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
  letter-spacing: 0.04em;
}

.fq-score-float--up {
  animation: fq-float-rise 1.5s ease-out forwards;
}

@keyframes fq-float-rise {
  0%   { opacity: 0;   transform: translateY(4px); }
  18%  { opacity: 1; }
  75%  { opacity: 0.8; }
  100% { opacity: 0;   transform: translateY(-44px); }
}

/* ---- Break Suggestion Card ---- */
.fq-break-card {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 270px;
  background: rgba(10, 10, 13, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 15px 17px;
  z-index: 800;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  font-family: var(--font-family);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.34, 1.1, 0.64, 1);
  pointer-events: none;
}

.fq-break-card.hidden { display: none; }

.fq-break-card.fq-break-in {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.fq-break-card.fq-break-out {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.32s ease, transform 0.32s ease;
  pointer-events: none;
}

.fq-break-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
}

.fq-break-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.fq-break-content { flex: 1; min-width: 0; }

.fq-break-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  margin-bottom: 3px;
}

.fq-break-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
  line-height: 1.35;
}

.fq-break-actions { display: flex; gap: 7px; }

.fq-break-accept {
  flex: 1;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.28);
  color: rgba(168, 85, 247, 0.88);
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: var(--font-family);
  letter-spacing: 0.04em;
  min-height: 36px;
}

.fq-break-accept:hover { background: rgba(168, 85, 247, 0.22); }

.fq-break-dismiss {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  padding: 8px 13px;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: var(--font-family);
  min-height: 36px;
}

.fq-break-dismiss:hover { color: rgba(255, 255, 255, 0.65); }

/* ---- Mobile overrides ---- */
@media (max-width: 600px) {
  .fq-quest-panel {
    left: 10px;
    right: 10px;
    width: auto;
    top: auto;
    bottom: calc(max(15px, env(safe-area-inset-bottom)) + 130px);
    transform: none;
    max-height: 72vh;
    border-radius: 18px 18px 0 0;
  }

  .fq-break-card {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: calc(max(15px, env(safe-area-inset-bottom)) + 130px);
  }

  .fq-score-floats {
    right: 16px;
    bottom: calc(max(15px, env(safe-area-inset-bottom)) + 145px);
  }

  .fq-compact-quest {
    max-width: 70vw;
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .fq-task-item,
  .fq-break-card,
  .fq-score-float,
  .fq-prog-fill,
  .fq-score-bar,
  .fq-quest-panel.fq-day-glow {
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================
   POMODORO INFO SECTION
   ========================================== */
.pomo-info-section {
  width: 100%;
  max-width: 800px;
  padding: 60px 24px 120px;
  margin: 0 auto;
}

.pomo-info-inner {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.pomo-info-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 28px 28px 32px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pomo-info-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 14px;
  letter-spacing: -0.2px;
}

.pomo-info-body {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.pomo-info-list {
  font-size: 14px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.6);
  padding-left: 20px;
  margin: 0;
}

.pomo-info-list li {
  margin-bottom: 4px;
}

.pomo-info-list strong {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
}

.pomo-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.pomo-feature-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 16px 16px 18px;
  transition: background 0.2s, border-color 0.2s;
}

.pomo-feature-card:hover {
  background: rgba(168, 85, 247, 0.07);
  border-color: rgba(168, 85, 247, 0.25);
}

.pomo-feature-icon {
  font-size: 22px;
  margin-bottom: 8px;
}

.pomo-feature-name {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 6px;
}

.pomo-feature-desc {
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.45);
}

/* Scroll + layout for focusPage — fixed-height internal scroll container
   (body is position:fixed; overflow:hidden so we scroll inside the page) */
#focusPage {
  justify-content: flex-start;
  height: 100dvh;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Timer section: fills exactly one viewport and centers its content,
   so the clock looks exactly like it always did — info section scrolls below */
#focusPage .pomodoro-container {
  min-height: 100dvh;
  min-height: 100vh;
  justify-content: center;
  padding: 60px 0 40px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .pomo-info-section { padding: 40px 16px 200px; }
  .pomo-info-block { padding: 20px 18px 24px; }
  .pomo-info-title { font-size: 16px; }
  .pomo-feature-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pomo-feature-card { padding: 12px 12px 14px; }
}

/* ==========================================
   PINCH-TO-SCALE (set via JS --fw-scale var)
   ========================================== */
.focus-world-wrapper {
  transform: scale(var(--fw-scale, 1));
  transform-origin: bottom left;
}
